\(\int (a+a \cos (c+d x)) \sec (c+d x) \, dx\) [7]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 16 \[ \int (a+a \cos (c+d x)) \sec (c+d x) \, dx=a x+\frac {a \text {arctanh}(\sin (c+d x))}{d} \]

[Out]

a*x+a*arctanh(sin(d*x+c))/d

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2814, 3855} \[ \int (a+a \cos (c+d x)) \sec (c+d x) \, dx=\frac {a \text {arctanh}(\sin (c+d x))}{d}+a x \]

[In]

Int[(a + a*Cos[c + d*x])*Sec[c + d*x],x]

[Out]

a*x + (a*ArcTanh[Sin[c + d*x]])/d

Rule 2814

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = a x+a \int \sec (c+d x) \, dx \\ & = a x+\frac {a \text {arctanh}(\sin (c+d x))}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00 \[ \int (a+a \cos (c+d x)) \sec (c+d x) \, dx=a x+\frac {a \text {arctanh}(\sin (c+d x))}{d} \]

[In]

Integrate[(a + a*Cos[c + d*x])*Sec[c + d*x],x]

[Out]

a*x + (a*ArcTanh[Sin[c + d*x]])/d

Maple [A] (verified)

Time = 1.14 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.81

method result size
derivativedivides \(\frac {a \left (d x +c \right )+a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(29\)
default \(\frac {a \left (d x +c \right )+a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(29\)
parts \(\frac {a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {a \left (d x +c \right )}{d}\) \(31\)
parallelrisch \(\frac {a \left (d x +\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )\right )}{d}\) \(36\)
risch \(a x +\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}\) \(42\)
norman \(\frac {a x +a x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) \(71\)

[In]

int((a+cos(d*x+c)*a)*sec(d*x+c),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(d*x+c)+a*ln(sec(d*x+c)+tan(d*x+c)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 36 vs. \(2 (16) = 32\).

Time = 0.27 (sec) , antiderivative size = 36, normalized size of antiderivative = 2.25 \[ \int (a+a \cos (c+d x)) \sec (c+d x) \, dx=\frac {2 \, a d x + a \log \left (\sin \left (d x + c\right ) + 1\right ) - a \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, d} \]

[In]

integrate((a+a*cos(d*x+c))*sec(d*x+c),x, algorithm="fricas")

[Out]

1/2*(2*a*d*x + a*log(sin(d*x + c) + 1) - a*log(-sin(d*x + c) + 1))/d

Sympy [A] (verification not implemented)

Time = 2.51 (sec) , antiderivative size = 49, normalized size of antiderivative = 3.06 \[ \int (a+a \cos (c+d x)) \sec (c+d x) \, dx=a x + a \left (\begin {cases} \frac {x \tan {\left (c \right )} \sec {\left (c \right )}}{\tan {\left (c \right )} + \sec {\left (c \right )}} + \frac {x \sec ^{2}{\left (c \right )}}{\tan {\left (c \right )} + \sec {\left (c \right )}} & \text {for}\: d = 0 \\\frac {\log {\left (\tan {\left (c + d x \right )} + \sec {\left (c + d x \right )} \right )}}{d} & \text {otherwise} \end {cases}\right ) \]

[In]

integrate((a+a*cos(d*x+c))*sec(d*x+c),x)

[Out]

a*x + a*Piecewise((x*tan(c)*sec(c)/(tan(c) + sec(c)) + x*sec(c)**2/(tan(c) + sec(c)), Eq(d, 0)), (log(tan(c +
d*x) + sec(c + d*x))/d, True))

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.75 \[ \int (a+a \cos (c+d x)) \sec (c+d x) \, dx=\frac {{\left (d x + c\right )} a + a \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right )}{d} \]

[In]

integrate((a+a*cos(d*x+c))*sec(d*x+c),x, algorithm="maxima")

[Out]

((d*x + c)*a + a*log(sec(d*x + c) + tan(d*x + c)))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 43 vs. \(2 (16) = 32\).

Time = 0.34 (sec) , antiderivative size = 43, normalized size of antiderivative = 2.69 \[ \int (a+a \cos (c+d x)) \sec (c+d x) \, dx=\frac {{\left (d x + c\right )} a + a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{d} \]

[In]

integrate((a+a*cos(d*x+c))*sec(d*x+c),x, algorithm="giac")

[Out]

((d*x + c)*a + a*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - a*log(abs(tan(1/2*d*x + 1/2*c) - 1)))/d

Mupad [B] (verification not implemented)

Time = 13.70 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.25 \[ \int (a+a \cos (c+d x)) \sec (c+d x) \, dx=a\,x+\frac {2\,a\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]

[In]

int((a + a*cos(c + d*x))/cos(c + d*x),x)

[Out]

a*x + (2*a*atanh(tan(c/2 + (d*x)/2)))/d